package miao.demo;

import miao.demo.config.SpringConfig;
import miao.demo.dao.BookDao;
import miao.demo.service.impl.BookServiceImpl;
import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.AnnotationConfigApplicationContext;

/*
    目标：掌握spring的纯注解开发
 */
public class AppForAnnotation {
    public static void main(String[] args) {
        ApplicationContext ctx = new AnnotationConfigApplicationContext(SpringConfig.class);
        BookDao bookDao = ctx.getBean("bookDao", BookDao.class);
        System.out.println(bookDao);
        BookServiceImpl bookService = ctx.getBean(BookServiceImpl.class);
        System.out.println(bookService);
    }
}
